//
//  ProgressViewController.m
//  EducationOID
//
//  Created by slz on 2017/8/3.
//  Copyright © 2017年 bnsr. All rights reserved.
//

#import "ProgressViewController.h"
#import "ProgressListModel.h"
#import "ProgressTableViewAdapter.h"

@interface ProgressViewController ()<TGMMode2TableViewAdapterDelegate>
@property (nonatomic,strong) YWTableView *tableView;
@end

@implementation ProgressViewController
{
    ProgressTableViewAdapter * _tableAdapter;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.showNavigationBar = YES;
    [self setControllerTitle:@"申请列表"];
    self.view.backgroundColor = kChange_InfoColor_bakc_Default;
    UIBarButtonItem * item = [UIBarButtonItem itemWithImage:@"top_back_1" selectImage:nil addTarget:self andAction:@selector(backAction)];
    self.navigationItem.leftBarButtonItem = item;

    
    _tableView = [[YWTableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
    _tableView.backgroundColor = kChange_InfoColor_bakc_Default;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableView];
    
    [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.view);
    }];
    
    
    [self initTableView];
    // Do any additional setup after loading the view.
}

-(void)initTableView{
    _tableAdapter = [[ProgressTableViewAdapter alloc]init];
    _tableAdapter.contextViewController = self;
    _tableAdapter.delegate = self;
    [_tableAdapter bindTableView:_tableView withModel:[ProgressListModel managedModelInstance] actionData:[[ProgressListModel managedModelInstance] actionData] atOffsetY:0];
    [_tableAdapter requestRefresh];
}

- (void)backAction{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
